import 'package:sample2/model/chat/chat_constants.dart';
import 'package:sample2/model/chat/chat_room.dart';

class ChatUser extends ChatRoom {
  String userId;
  String userName;
  String time;
  ChatPeerStatus status = ChatPeerStatus.offline;

  ///unread message count in the chat list
  int? unreadMessageCount = 0;
  ChatUser(
      {required super.chatId,
      required this.userName,
      required this.userId,
      required this.time,
      required this.status,
      this.unreadMessageCount});

  String getStatusDesc() {
    switch (status) {
      case ChatPeerStatus.offline:
        return "offline";
      case ChatPeerStatus.online:
        return "online";
      case ChatPeerStatus.onlineBusy:
        return "busy";
      case ChatPeerStatus.onlineNotDisturb:
        return "dont disturb";
      default:
        return "known";
    }
  }
}

class ChatMessageUser extends ChatUser {
  String? lastMessage;
  ChatMessageUser(
      {required super.userName,
      required super.userId,
      required super.time,
      required super.chatId,
      required super.status,
      super.unreadMessageCount,
      this.lastMessage});
}
